<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>UDisksState: UDisks Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="UDisks Reference Manual">
<link rel="up" href="ref-daemon-core.html" title="Core">
<link rel="prev" href="UDisksProvider.html" title="UDisksProvider">
<link rel="next" href="udisks2-ATA-commands.html" title="ATA commands">
<meta name="generator" content="GTK-Doc V1.29 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#UDisksState.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#UDisksState.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#UDisksState.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ref-daemon-core.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="UDisksProvider.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="udisks2-ATA-commands.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="UDisksState"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="UDisksState.top_of_page"></a>UDisksState</span></h2>
<p>UDisksState — Object used for recording state and cleaning up</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="UDisksState.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="UDisksState.html" title="UDisksState"><span class="returnvalue">UDisksState</span></a> *
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-new" title="udisks_state_new ()">udisks_state_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-start-cleanup" title="udisks_state_start_cleanup ()">udisks_state_start_cleanup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-stop-cleanup" title="udisks_state_stop_cleanup ()">udisks_state_stop_cleanup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-check" title="udisks_state_check ()">udisks_state_check</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-check-sync" title="udisks_state_check_sync ()">udisks_state_check_sync</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="returnvalue">UDisksDaemon</span></a> *
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-get-daemon" title="udisks_state_get_daemon ()">udisks_state_get_daemon</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-add-mounted-fs" title="udisks_state_add_mounted_fs ()">udisks_state_add_mounted_fs</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-find-mounted-fs" title="udisks_state_find_mounted_fs ()">udisks_state_find_mounted_fs</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-add-unlocked-crypto-dev" title="udisks_state_add_unlocked_crypto_dev ()">udisks_state_add_unlocked_crypto_dev</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">dev_t</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-find-unlocked-crypto-dev" title="udisks_state_find_unlocked_crypto_dev ()">udisks_state_find_unlocked_crypto_dev</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-add-loop" title="udisks_state_add_loop ()">udisks_state_add_loop</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-has-loop" title="udisks_state_has_loop ()">udisks_state_has_loop</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-add-mdraid" title="udisks_state_add_mdraid ()">udisks_state_add_mdraid</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="UDisksState.html#udisks-state-has-mdraid" title="udisks_state_has_mdraid ()">udisks_state_has_mdraid</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="UDisksState.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody><tr>
<td class="property_type">
<a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *</td>
<td class="property_name"><a class="link" href="UDisksState.html#UDisksState--daemon" title="The “daemon” property">daemon</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="UDisksState.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody><tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="UDisksState.html#UDisksState-struct" title="UDisksState">UDisksState</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="UDisksState.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
    <span class="lineart">╰──</span> UDisksState
</pre>
</div>
<div class="refsect1">
<a name="UDisksState.description"></a><h2>Description</h2>
<p>This type is used for recording actions done by users and cleaning
up when devices set up via the udisks interfaces are removed while
still in use - for example, a USB stick being yanked.</p>
<p>The following files are used:</p>
<div class="table">
<a name="id-1.5.2.6.7.4"></a><p class="title"><b>Table 3. Persistent information and state</b></p>
<div class="table-contents"><table class="table" summary="Persistent information and state" border="1">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th align="left">File</th>
<th align="left">Usage</th>
</tr></thead>
<tbody>
<tr>
<td align="left"><code class="filename">/run/udisks2/mounted-fs</code></td>
<td align="left">
          A serialized 'a{sa{sv}}' <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> mapping from the
          mount point (e.g. <code class="filename">/media/EOS_DIGITAL</code>) into a set of details.
          Known details include
          <code class="literal">block-device</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-UINT64:CAPS">'t'</a>) that is the <span class="type">dev_t</span>
          for the mounted device,
          <code class="literal">mounted-by-uid</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-UINT32:CAPS">'u'</a>) that is the <span class="type">uid_t</span>
          of the user who mounted the device, and
          <code class="literal">fstab-mount</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</a>) that is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
          if the device was mounted via an entry in /etc/fstab.
        </td>
</tr>
<tr>
<td align="left"><code class="filename">/run/udisks2/unlocked-crypto-dev</code></td>
<td align="left">
          A serialized 'a{ta{sv}}' <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> mapping from the
          <span class="type">dev_t</span> of the clear-text device (e.g. <code class="filename">/dev/dm-0</code>) into a set of details.
          Known details include
          <code class="literal">crypto-device</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-UINT64:CAPS">'t'</a>) that is the <span class="type">dev_t</span>
          for the crypto-text device,
          <code class="literal">dm-uuid</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-ARRAY:CAPS">'ay'</a>) that is the device mapper UUID
          for the clear-text device and
          <code class="literal">unlocked-by-uid</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-UINT32:CAPS">'u'</a>) that is the <span class="type">uid_t</span>
          of the user who unlocked the device.
        </td>
</tr>
<tr>
<td align="left"><code class="filename">/run/udisks2/loop</code></td>
<td align="left">
          A serialized 'a{sa{sv}}' <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> mapping from the
          loop device name (e.g. <code class="filename">/dev/loop0</code>) into a set of details.
          Known details include
          <code class="literal">backing-file</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-ARRAY:CAPS">'ay'</a>) for the name of the backing file and
          <code class="literal">backing-file-device</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-UINT64:CAPS">'t'</a>) for the <span class="type">dev_t</span>
          for of the device holding the backing file (or 0 if unknown) and
          <code class="literal">setup-by-uid</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-UINT32:CAPS">'u'</a>) that is the <span class="type">uid_t</span>
          of the user who set up the loop device.
        </td>
</tr>
<tr>
<td align="left"><code class="filename">/run/udisks2/mdraid</code></td>
<td align="left">
          A serialized 'a{ta{sv}}' <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> mapping from the
          <span class="type">dev_t</span> of the raid device (e.g. <code class="filename">/dev/md127</code>) into a set of details.
          Known details include
          <code class="literal">started-by-uid</code>
          (of type <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-UINT32:CAPS">'u'</a>) that is the <span class="type">uid_t</span>
          of the user who started the array.
        </td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p>Cleaning up is implemented by running a thread (to ensure that
actions are serialized) that checks all data in the files mentioned
above and cleans up the entry in question by e.g. unmounting a
filesystem, removing a mount point or tearing down a device-mapper
device when needed. The clean-up thread itself needs to be manually
kicked using e.g. <a class="link" href="UDisksState.html#udisks-state-check" title="udisks_state_check ()"><code class="function">udisks_state_check()</code></a> from suitable places in
the <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> and <a class="link" href="UDisksProvider.html" title="UDisksProvider"><span class="type">UDisksProvider</span></a> implementations.</p>
<p>Since cleaning up is only necessary when a device has been removed
without having been properly stopped or shut down, the fact that it
was cleaned up is logged to ensure that the information is brought
to the attention of the system administrator.</p>
</div>
<div class="refsect1">
<a name="UDisksState.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="udisks-state-new"></a><h3>udisks_state_new ()</h3>
<pre class="programlisting"><a class="link" href="UDisksState.html" title="UDisksState"><span class="returnvalue">UDisksState</span></a> *
udisks_state_new (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>);</pre>
<p>Creates a new <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> object.</p>
<div class="refsect3">
<a name="udisks-state-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>daemon</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="udisks-state-new.returns"></a><h4>Returns</h4>
<p> A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> that should be freed with <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-start-cleanup"></a><h3>udisks_state_start_cleanup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_start_cleanup (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre>
<p>Starts the clean-up thread.</p>
<p>The clean-up thread will hold a reference to <em class="parameter"><code>state</code></em>
 for as long as
it's running - use <a class="link" href="UDisksState.html#udisks-state-stop-cleanup" title="udisks_state_stop_cleanup ()"><code class="function">udisks_state_stop_cleanup()</code></a> to stop it.</p>
<div class="refsect3">
<a name="udisks-state-start-cleanup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-stop-cleanup"></a><h3>udisks_state_stop_cleanup ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_stop_cleanup (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre>
<p>Stops the clean-up thread. Blocks the calling thread until it has stopped.</p>
<div class="refsect3">
<a name="udisks-state-stop-cleanup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-check"></a><h3>udisks_state_check ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_check (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre>
<p>Causes the clean-up thread for <em class="parameter"><code>state</code></em>
 to check if anything should be cleaned up.</p>
<p>This can be called from any thread and will not block the calling thread.</p>
<div class="refsect3">
<a name="udisks-state-check.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-check-sync"></a><h3>udisks_state_check_sync ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_check_sync (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre>
<p>Causes the clean-up thread for <em class="parameter"><code>state</code></em>
 to check if anything should be cleaned up and perform the cleanup.</p>
<p>This can be called from any thread and in contrast to <a class="link" href="UDisksState.html#udisks-state-check" title="udisks_state_check ()"><code class="function">udisks_state_check()</code></a> will block the calling thread until cleanup is finished.</p>
<div class="refsect3">
<a name="udisks-state-check-sync.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-get-daemon"></a><h3>udisks_state_get_daemon ()</h3>
<pre class="programlisting"><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="returnvalue">UDisksDaemon</span></a> *
udisks_state_get_daemon (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre>
<p>Gets the daemon used by <em class="parameter"><code>state</code></em>
.</p>
<div class="refsect3">
<a name="udisks-state-get-daemon.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="udisks-state-get-daemon.returns"></a><h4>Returns</h4>
<p> A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>. Do not free, the object is owned by <em class="parameter"><code>state</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-add-mounted-fs"></a><h3>udisks_state_add_mounted_fs ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_add_mounted_fs (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                             <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mount_point</code></em>,
                             <em class="parameter"><code><span class="type">dev_t</span> block_device</code></em>,
                             <em class="parameter"><code><span class="type">uid_t</span> uid</code></em>,
                             <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> fstab_mount</code></em>);</pre>
<p>Adds a new entry to the
<code class="filename">/run/udisks2/mounted-fs</code> file.</p>
<div class="refsect3">
<a name="udisks-state-add-mounted-fs.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>block_device</p></td>
<td class="parameter_description"><p>The block device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mount_point</p></td>
<td class="parameter_description"><p>The mount point.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>uid</p></td>
<td class="parameter_description"><p>The user id of the process requesting the device to be mounted.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>fstab_mount</p></td>
<td class="parameter_description"><p><a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the device was mounted via /etc/fstab.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-find-mounted-fs"></a><h3>udisks_state_find_mounted_fs ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
udisks_state_find_mounted_fs (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                              <em class="parameter"><code><span class="type">dev_t</span> block_device</code></em>,
                              <em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>,
                              <em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *out_fstab_mount</code></em>);</pre>
<p>Gets the mount point for <em class="parameter"><code>block_device</code></em>
, if it exists in the
<code class="filename">/run/udisks2/mounted-fs</code> file.</p>
<div class="refsect3">
<a name="udisks-state-find-mounted-fs.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>block_device</p></td>
<td class="parameter_description"><p>The block device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_uid</p></td>
<td class="parameter_description"><p>Return location for the user id who mounted the device or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_fstab_mount</p></td>
<td class="parameter_description"><p>Return location for whether the device was a fstab mount or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="udisks-state-find-mounted-fs.returns"></a><h4>Returns</h4>
<p> The mount point for <em class="parameter"><code>block_device</code></em>
or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if not found.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-add-unlocked-crypto-dev"></a><h3>udisks_state_add_unlocked_crypto_dev ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_add_unlocked_crypto_dev (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                                      <em class="parameter"><code><span class="type">dev_t</span> cleartext_device</code></em>,
                                      <em class="parameter"><code><span class="type">dev_t</span> crypto_device</code></em>,
                                      <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dm_uuid</code></em>,
                                      <em class="parameter"><code><span class="type">uid_t</span> uid</code></em>);</pre>
<p>Adds a new entry to the
<code class="filename">/run/udisks2/unlocked-crypto-dev</code> file.</p>
<div class="refsect3">
<a name="udisks-state-add-unlocked-crypto-dev.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cleartext_device</p></td>
<td class="parameter_description"><p>The clear-text device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>crypto_device</p></td>
<td class="parameter_description"><p>The crypto device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dm_uuid</p></td>
<td class="parameter_description"><p>The UUID of the unlocked dm device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>uid</p></td>
<td class="parameter_description"><p>The user id of the process requesting the device to be unlocked.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-find-unlocked-crypto-dev"></a><h3>udisks_state_find_unlocked_crypto_dev ()</h3>
<pre class="programlisting"><span class="returnvalue">dev_t</span>
udisks_state_find_unlocked_crypto_dev (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                                       <em class="parameter"><code><span class="type">dev_t</span> crypto_device</code></em>,
                                       <em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>);</pre>
<p>Gets the clear-text device for <em class="parameter"><code>crypto_device</code></em>
, if it exists in the
<code class="filename">/run/udisks2/unlocked-crypto-dev</code> file.</p>
<div class="refsect3">
<a name="udisks-state-find-unlocked-crypto-dev.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>crypto_device</p></td>
<td class="parameter_description"><p>The block device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_uid</p></td>
<td class="parameter_description"><p>Return location for the user id who mounted the device or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="udisks-state-find-unlocked-crypto-dev.returns"></a><h4>Returns</h4>
<p> The cleartext device for <em class="parameter"><code>crypto_device</code></em>
or 0 if not found.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-add-loop"></a><h3>udisks_state_add_loop ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_add_loop (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                       <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *device_file</code></em>,
                       <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *backing_file</code></em>,
                       <em class="parameter"><code><span class="type">dev_t</span> backing_file_device</code></em>,
                       <em class="parameter"><code><span class="type">uid_t</span> uid</code></em>);</pre>
<p>Adds a new entry to the <code class="filename">/run/udisks2/loop</code>
file.</p>
<div class="refsect3">
<a name="udisks-state-add-loop.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device_file</p></td>
<td class="parameter_description"><p>The loop device file.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>backing_file</p></td>
<td class="parameter_description"><p>The backing file.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>backing_file_device</p></td>
<td class="parameter_description"><p>The <span class="type">dev_t</span> of the backing file or 0 if unknown.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>uid</p></td>
<td class="parameter_description"><p>The user id of the process requesting the loop device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-has-loop"></a><h3>udisks_state_has_loop ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
udisks_state_has_loop (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                       <em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *device_file</code></em>,
                       <em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>);</pre>
<p>Checks if <em class="parameter"><code>device_file</code></em>
 is set up via udisks.</p>
<div class="refsect3">
<a name="udisks-state-has-loop.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device_file</p></td>
<td class="parameter_description"><p>A loop device file.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_uid</p></td>
<td class="parameter_description"><p>Return location for the user id who setup the loop device or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Return location for error or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="udisks-state-has-loop.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if set up via udisks, otherwise <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> or if <em class="parameter"><code>error</code></em>
is set.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-add-mdraid"></a><h3>udisks_state_add_mdraid ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
udisks_state_add_mdraid (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                         <em class="parameter"><code><span class="type">dev_t</span> raid_device</code></em>,
                         <em class="parameter"><code><span class="type">uid_t</span> uid</code></em>);</pre>
<p>Adds a new entry to the <code class="filename">/run/udisks2/mdraid</code>
file.</p>
<div class="refsect3">
<a name="udisks-state-add-mdraid.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>raid_device</p></td>
<td class="parameter_description"><p>The <span class="type">dev_t</span> for the RAID device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>uid</p></td>
<td class="parameter_description"><p>The user id of the process requesting the loop device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udisks-state-has-mdraid"></a><h3>udisks_state_has_mdraid ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
udisks_state_has_mdraid (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>,
                         <em class="parameter"><code><span class="type">dev_t</span> raid_device</code></em>,
                         <em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>);</pre>
<p>Checks if <em class="parameter"><code>raid_device</code></em>
 is set up via udisks.</p>
<div class="refsect3">
<a name="udisks-state-has-mdraid.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>state</p></td>
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>raid_device</p></td>
<td class="parameter_description"><p>A <span class="type">dev_t</span> for the RAID device.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_uid</p></td>
<td class="parameter_description"><p>Return location for the user id who setup the loop device or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Return location for error or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="udisks-state-has-mdraid.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if set up via udisks, otherwise <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> or if <em class="parameter"><code>error</code></em>
is set.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="UDisksState.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="UDisksState-struct"></a><h3>UDisksState</h3>
<pre class="programlisting">typedef struct _UDisksState UDisksState;</pre>
<p>The <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> structure contains only private data and should
only be accessed using the provided API.</p>
</div>
</div>
<div class="refsect1">
<a name="UDisksState.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="UDisksState--daemon"></a><h3>The <code class="literal">“daemon”</code> property</h3>
<pre class="programlisting">  “daemon”                   <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *</pre>
<p>The <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> object.</p>
<p>Flags: Read / Write / Construct Only</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.29</div>
</body>
</html>